<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>假期审批</title>
    <link rel="stylesheet" type="text/css"
          href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css"
          href="easyui/demo/demo.css">
    <script type="text/javascript"
            src="common/lib/jquery-1.8.3.min.js"></script>
    <script type="text/javascript"
            src="easyui/jquery.min.js"></script>
    <script type="text/javascript"
            src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="common/js/emp.js"></script>
</head>

<body>
<div style="margin: -12px 0;"></div>
<table id="dg" title="假 期 审 批(未 通 过 审 核)" style="width: 100%;"
       data-options="rownumbers:true,singleSelect:true,pagination:true,
				onClickRow: onClickRow,url:'/OASystem/leave/getnotpass',method:'get',toolbar:'#tb',nowrap:false">
    <thead>
    <tr>
        <th style="width: 10%" data-options="field:'eId',align:'center'">工号</th>
        <th style="width: 10%" data-options="field:'name',align:'center'">姓名</th>
        <th style="width: 15%" data-options="field:'leaveTime',align:'center'">申请时间</th>
        <th style="width: 15%" data-options="field:'start',width:100,align:'center'">假期开始时间</th>
        <th style="width: 15%" data-options="field:'end',align:'center'">假期结束时间</th>
        <th style="width: 35%;padding-left: 10px;padding-right: 10px;"
            data-options="field:'leaveReason',align:'center'">申假原因
        </th>
        <th style="width: 35%;padding-left: 10px;padding-right: 10px;"
            data-options="field:'failMessage',align:'center'">未通过原因
        </th>
    </tr>
    </thead>
</table>
<div id="tb" style="font-size: 17px;height: 50px;padding-top: 9px;">
    <div style="margin-top: 10px">
        &emsp;姓名&emsp;<input style="font-size: 15px;" type="text" name="standard.name" id="emp_name"/>&emsp;&emsp;
        工号&emsp;<input style="font-size: 15px" type="text" name="standard.minWeight" id="emp_eId"/>&emsp;&emsp;
        <a id="standardQueryBtn" href="javascript:void(0)"
           class="easyui-linkbutton" data-options="iconCls:'icon-search'">搜索</a>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        var pager = $('#dg').datagrid().datagrid('getPager');
    })


    var editIndex = undefined;

    function endEditing() {
        if (editIndex == undefined) {
            return true
        }
        if ($('#dg').datagrid('validateRow', editIndex)) {
            var ed = $('#dg').datagrid('getEditor', {index: editIndex, field: 'productid'});
            var productname = $(ed.target).combobox('getText');
            $('#dg').datagrid('getRows')[editIndex]['productname'] = productname;
            $('#dg').datagrid('endEdit', editIndex);
            editIndex = undefined;
            return true;
        } else {
            return false;
        }
    }

    function onClickRow(index) {
        if (editIndex != index) {
            if (endEditing()) {
                $('#dg').datagrid('selectRow', index)
                    .datagrid('beginEdit', index);
                editIndex = index;
            } else {
                $('#dg').datagrid('selectRow', editIndex);
            }
        }
    }

    $("#standardQueryBtn").click(function () {
        //$("#dg") 获取easui的数据表格   datagrid("load" 重新加载表格 后面的几个数据是请求的参数
        $("#dg").datagrid("load", {
            "name": $("#emp_name").val(),
            "eId": $("#emp_eId").val()
        });
    });
</script>
</body>

</html>